layui.use(['form', 'layedit', 'laydate','jquery'], function(){
  var form = layui.form;
  var layer = layui.layer;
  var layedit = layui.layedit;
  var laydate = layui.laydate;
  var $ = layui.$ //重点处;
  //监听提交
  form.on('submit(submit)', function(data){
    $("#submit").attr("disabled","disabled");
    $.ajax({ 
    	url: "/sys/sys_user/edit", 
    	type: "POST",
    	data: data.field, 
    	dataType: "json",
    	success: function(result){
    		if(result.success){
        		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        		var tools = window.parent.tools;
        		if(tools){
        			tools.search();
        		}
        		var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
                parent.layer.close(index);	
        	}else{
        		layer.msg(result.msg);
        	}
    	},
    	error: function(){
    		layer.msg("网络繁忙,请稍候重试....");
    	},
    	complete: function () {
    		$("#submit").removeAttr("disabled");
    	}
    });
    return false;
  });

});